package cn.org.rookie.jeesdp.core.utils;

import java.io.Closeable;
import java.io.IOException;

/**
 * @author LHT
 * @date 2022-10-12 23:11
 */

public abstract class IOUtils extends org.apache.commons.io.IOUtils {

    public static String userDir() {
        return System.getProperty("user.dir");
    }

    public static String userHome() {
        return System.getProperty("user.home");
    }

    public static String tempDir() {
        return System.getProperty("java.io.tmpdir");
    }

    public static String classpath() {
        return System.getProperty("java.class.path");
    }

    public static void close(Closeable... closeables) {
        for (Closeable closeable : closeables) {
            if (closeable != null) {
                try {
                    closeable.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
